package com.bykj.property.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import com.bykj.property.controller.vo.request.RepairOrderPageRequest;
import com.bykj.property.model.RepairOrder;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.mapping.FetchType;

/**
* <p>
    * 报修信息表 Mapper 接口
    * </p>
*
* @author liangyiming
* @since 2019-07-23
*/
public interface RepairOrderMapper extends BaseMapper<RepairOrder> {

    @Select("select  * from repair_order ")
                @Results({
                        @Result(property = "pmProprietorId",column = "pm_proprietor_id"),
                        @Result(property = "repairPersonId",column = "repair_person_id"),
                        @Result(property = "pmProprietor",column = "pm_proprietor_id",one = @One(select = "com.bykj.property.mapper.PmProprietorMapper.selectById"))
                ,@Result(property = "repairPerson",column = "repair_person_id",one = @One(select = "com.bykj.property.mapper.RepairPersonMapper.selectById"))
    })
    Page<RepairOrder> queryPage(RepairOrderPageRequest pageRequest);

    int saveToKey(RepairOrder repairOrder);
}